import { ref } from 'vue'
import { defineStore } from 'pinia'


export const useLocaleStore = defineStore('locale', () => {
  const language = ref(null)

  const setLocaleLanguage = (lang) => {
    language.value = lang
  }

  const getLocaleLanguage = () => {
    return language.value || 'zh'
  }


  return {
    language,
    setLocaleLanguage,
    getLocaleLanguage
  }
}, { persist: true }) // 使用持久化存储
